<?php
class M_student_payment_schedule extends MY_Model
{
	public function get_student_profile($id){
		$sql = "SELECT enrollments.e_sy_from,
					 				 enrollments.e_sy_to,
					 				 enrollments.e_ay_id,
					 				 enrollments.e_grade_level,
					 				 profiles.firstname, 
									 profiles.middlename, 
									 profiles.lastname,
									 profiles.name_ext
						FROM enrollments 
						LEFT JOIN profiles ON enrollments.e_profile_id = profiles.profile_id
						WHERE enrollments.e_id = ?";
	
		$query = $this->db->query($sql,array($id));
		return $query->num_rows() >= 1 ? $query->row() : FALSE;
	}

	public function get_payment_mode_value($g_id,$sy_id){
		$sql = "SELECT payment_mode_values.payment_plan_amount,
									 payment_modes.payment_mode_name
						FROM payment_mode_values
						LEFT JOIN payment_modes ON payment_modes.id = payment_mode_values.payment_mode_id
						WHERE payment_mode_values.level_id = ?
						and payment_mode_values.ay_id = ?";
	
		$query = $this->db->query($sql,array($g_id,$sy_id));
		return $query->num_rows() >= 1 ? $query->result() : FALSE;
	}
}
?>